﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using System.ComponentModel;
using System.Collections.Generic;

namespace Lilium.ComponentModel
{
	public static class MemberDescriptorExtensions
	{
		public static IEnumerable<TAttribute> GetCustomAttributes<TAttribute>(this MemberDescriptor memberDescriptor)
		{
			if (memberDescriptor == null) throw new ArgumentNullException("memberDescriptor");

			return memberDescriptor.Attributes.OfType<TAttribute>();
		}
	}
}
